package com.cusprovider.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.cusprovider.dao.CustomerDao;
import com.pojo.Customer;
import com.service.CustomerService;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Component
@Transactional
@Service(interfaceClass = CustomerService.class)
public class CustomerServiceImpl implements CustomerService {

    @Resource
    private CustomerDao customerDao;

    @Override
    public List<Customer> getCustomer() {
        return customerDao.getCustomer();
    }

    @Override
    public int customerUpdate(Customer customer) {
        return customerDao.customerUpdate(customer);
    }

    @Override
    public int customerAdd(Customer customer) {
        return customerDao.customerAdd(customer);
    }

    @Override
    public int customerDelete(int id) {
        return customerDao.customerDelete(id);
    }
}

